//
//  AIMyLibraryTopCell.m
//  HNBaseProject
//
//  Created by xujie on 2024/9/15.
//

#import "AIMyLibraryTopCell.h"

@implementation AIMyLibraryTopCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self createUI];
    }
    return self;
}

- (void)createUI {
    
    self.backgroundColor = [UIColor colorWithHexString:@"#F5F8FB"];
    self.bgImageV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"圆角矩形 1705"]];
    [self.contentView addSubview:self.bgImageV];
    self.bgImageV.frame = CGRectMake(15, 0, kScreenW-30, 110);
    
    self.titleLab = [[UILabel alloc] initWithFrame:CGRectMake(15, 26, 200, 14)];
    self.titleLab.text =  NSLocalizedString(@"我的钻石", nil);
    self.titleLab.textColor = [UIColor colorWithHexString:@"#FCC783"];
    self.titleLab.font = kFontHeavy(15);
    [self.bgImageV addSubview:self.titleLab];
    
    self.moneyLab = [[UILabel alloc] init];
    [self.bgImageV addSubview:self.moneyLab];
    self.moneyLab.textColor = [UIColor whiteColor];
    self.moneyLab.font = kFontSemibold(24);
    [self.moneyLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(15);
        make.top.offset(60);
    }];
    
    self.diamodV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"dia_icon"]];
    [self.bgImageV addSubview:self.diamodV];
    [self.diamodV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.moneyLab.mas_right).offset(5);
        make.centerY.mas_equalTo(self.moneyLab);
    }];
    
    self.buyView = [[UIView alloc] initWithFrame:CGRectMake(kScreenW-30-85-15, 39, 85, 32)];
    self.buyView.layer.cornerRadius = 16;
    self.buyView.layer.masksToBounds = YES;
    [self.bgImageV addSubview:self.buyView];
    
    self.buyLab = [[UILabel alloc] init];
    self.buyLab.text = NSLocalizedString(@"购买", nil);
    self.buyLab.textColor = [UIColor colorWithHexString:@"#874A11"];
    self.buyLab.font = kFontHeavy(15);
    [self.buyView addSubview:self.buyLab];
    [self.buyLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.buyView);
    }];

    [UIView setGradientView:self.buyView colors:@[[UIColor colorWithHexString:@"#FBE6CB"],[UIColor colorWithHexString:@"#FECA81"]] cornerRadius:16];
    
//    self.moneyLab.text = @"5800";

}

@end
